import java.util.HashSet;

public class LQB_code1_8 {
    public static void main(String[] args) {
        String s = "0100110001010001";
        HashSet<String> set = new HashSet<String>();
        for (int i=0;i<s.length();i++){
            for (int j=i;j<s.length();j++){
                String string = s.substring(i,j+1);
                set.add(string);
            }
        }
        System.out.println(set.size());
    }
}
